package com.pda.xinma.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.pda.xinma.R;
import com.pda.xinma.bean.OrderBean;
import com.wangshen.base.ui.mvp.base.adapter.BaseAdapter;

import java.util.List;

public class OrderDetailAdapter extends BaseAdapter<OrderBean .ProcessInfosBean> {
    public OrderDetailAdapter(int layoutResId, @Nullable List<OrderBean.ProcessInfosBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, OrderBean.ProcessInfosBean item) {
        super.convert(helper, item);
        helper.setText(R.id.tv_processId,item.getProcessId());
        helper.setText(R.id.tv_processName,item.getProcessName());
        helper.setText(R.id.tv_actNum,item.getActNum()+"");
        helper.setText(R.id.tv_diskNum,item.getDiskNum()+"");
        helper.setText(R.id.tv_userIds,item.getUserIds());
        helper.setText(R.id.tv_completeTime,item.getCompleteTime());
        if (item.getStatus().equals("20")){
            helper.setTextColor(R.id.tv_processId,getContext().getResources().getColor(R.color.md_green_A400));
            helper.setTextColor(R.id.tv_processName,getContext().getResources().getColor(R.color.md_green_A400));
            helper.setTextColor(R.id.tv_actNum,getContext().getResources().getColor(R.color.md_green_A400));
            helper.setTextColor(R.id.tv_diskNum,getContext().getResources().getColor(R.color.md_green_A400));
            helper.setTextColor(R.id.tv_userIds,getContext().getResources().getColor(R.color.md_green_A400));
            helper.setTextColor(R.id.tv_completeTime,getContext().getResources().getColor(R.color.md_green_A400));
        }else {
            helper.setTextColor(R.id.tv_processId,getContext().getResources().getColor(R.color._333333));
            helper.setTextColor(R.id.tv_processName,getContext().getResources().getColor(R.color._333333));
            helper.setTextColor(R.id.tv_actNum,getContext().getResources().getColor(R.color._333333));
            helper.setTextColor(R.id.tv_diskNum,getContext().getResources().getColor(R.color._333333));
            helper.setTextColor(R.id.tv_userIds,getContext().getResources().getColor(R.color._333333));
            helper.setTextColor(R.id.tv_completeTime,getContext().getResources().getColor(R.color._333333));
        }
    }
}
